#ifndef CONDITION_H
#define CONDITION_H
#include<string>
#include<vector>
#include<user.h>
class Condition
{
public:
    std::string field;
    std::string op;
    std::string value;
    std::vector<Condition*> operands;
    Condition(std::string field = "", std::string op = "", std::string value = "") {
            this->field = field;
            this->op = op;
            this->value = value;
        }
    ~Condition(){
        for (auto& op: operands) {
            delete op;
        }
    }
    std::string toString();//用于调试
    bool evaluate(const std::vector<std::vector<std::string>> &record);//传入所有记录判断是否返回
private:
    int indexOf(const std::string& field,const std::vector<std::string>& header);

};

#endif // CONDITION_H
